/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 obstacle_type.cpp

	$Header: /heroes4/obstacle_type.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )


#include "obstacle_type.h"

#include "elements_of.h"
#include "enum_map.h"

#define DECLARE_KEYWORD( name ) k_obstacle_##name, #name

namespace
{
	t_char_ptr_pair const k_keywords[] =
	{
		{ DECLARE_KEYWORD( autumn_tree ) },
		{ DECLARE_KEYWORD( black_rock ) },
		{ DECLARE_KEYWORD( bones ) },
		{ DECLARE_KEYWORD( burnt_log ) },
		{ DECLARE_KEYWORD( cactus ) },
		{ DECLARE_KEYWORD( crack ) },
		{ DECLARE_KEYWORD( crate ) },
		{ DECLARE_KEYWORD( dead_tree ) },
		{ DECLARE_KEYWORD( decidous_tree ) },
		{ DECLARE_KEYWORD( desert_tree ) },
		{ DECLARE_KEYWORD( dry_shrub ) },
		{ DECLARE_KEYWORD( evergreen_tree ) },
		{ DECLARE_KEYWORD( geyser ) },
		{ DECLARE_KEYWORD( green_log ) },
		{ DECLARE_KEYWORD( gray_rock ) },
		{ DECLARE_KEYWORD( green_rock ) },
		{ DECLARE_KEYWORD( lava_crack ) },
		{ DECLARE_KEYWORD( log ) },
		{ DECLARE_KEYWORD( mushroom ) },
		{ DECLARE_KEYWORD( rope ) },
		{ DECLARE_KEYWORD( sack ) },
		{ DECLARE_KEYWORD( sandy_rock ) },
		{ DECLARE_KEYWORD( shrub ) },
		{ DECLARE_KEYWORD( snow_log ) },
		{ DECLARE_KEYWORD( snow_rock ) },
		{ DECLARE_KEYWORD( snow_shrub ) },
		{ DECLARE_KEYWORD( snow_tree ) },
		{ DECLARE_KEYWORD( sparkles ) },
		{ DECLARE_KEYWORD( stalagmite ) },
		{ DECLARE_KEYWORD( stump ) },
		{ DECLARE_KEYWORD( swamp_log ) },
		{ DECLARE_KEYWORD( swamp_shrub ) },
		{ DECLARE_KEYWORD( swamp_tree ) },
		{ DECLARE_KEYWORD( tan_rock ) },

		{ DECLARE_KEYWORD( castle_gate ) },
		{ DECLARE_KEYWORD( castle_tower ) },
		{ DECLARE_KEYWORD( castle_wall ) },
		{ DECLARE_KEYWORD( special ) },

	};

	t_enum_map<t_obstacle_type> k_keyword_map( k_keywords, ELEMENTS_OF( k_keywords ),
		                                       k_obstacle_type_count );

};

t_obstacle_type get_obstacle_type( std::string const& keyword )
{
	return k_keyword_map[keyword];
}

std::string     get_obstacle_keyword( t_obstacle_type type )
{
	return k_keyword_map[type];
}
